import 'package:flutter/material.dart';
import 'package:wis_flutter/index.dart';


// 登录页
class LoginHTML extends StatefulWidget {
  @override
  _LoginPageState createState() => new _LoginPageState();
}

class _LoginPageState extends State<LoginHTML> {

 
  TextEditingController _nameController =  TextEditingController();     // 账号
  TextEditingController _passwordController =  TextEditingController(); // 密码

  // 初始化
  @override
  void initState() {
    super.initState();
    
    this._initFunc();
  }

  void _initFunc() async{
      await new Future.delayed(new Duration(seconds: 5));

      _nameController.text="2323";
      _passwordController.text="dwewewewe";


  }


  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: '登录页',
      home: Scaffold(
          resizeToAvoidBottomInset: false,
          body: Builder(builder: (BuildContext contextIn) {
            return WisLogonPage(
                nameController:_nameController,
                passwordController:_passwordController,
                title: "登录页",
                defaultVal:{
                  "name":"32323",
                  "password":"2222"
                },
                // backgroundImage: NetworkImage("https://flutter.io/images/homepage/header-illustration.png"),
                // widgetContent: Container(
                //   margin: EdgeInsets.fromLTRB(0, 8, 0, 8),
                //   child: Text("这里面是 自定义的内容"),
                // ),
                onLogin: (option) {
                  print(option);
                  // Navigator.pushNamed(context,"/");
                }
                );
          })),
    );
  }
}
